<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<script type="text/javascript">
function menuTreeOnclick(event, treeId, treeNode, clickFlag){
	event.preventDefault();
	//如果不是父节点才可以进行设置
	if(treeNode.isParent){
		var zTree = $.fn.zTree.getZTreeObj(treeId);
        zTree.expandNode(treeNode, !treeNode.open, false, true, true)
        return;
	}
	//调用后台 初始化页面
	$("#role-fun-layout-02").bjuiajax('doLoad', {
		"url"    : "role/getFunAction.do",
		"data"   : {"funId":treeNode.id,"roleSn":'${roleSn}'},
		"target" : $("#role-fun-layout-02")
		});
}
function closePermissionSet(){
	$('#set-permission-dialog').dialog('closeCurrent');
}
</script>
<div class="bjui-pageContent" style="padding-bottom:0px; overflow:hidden;display:inline-block; ">
	<fieldset style="height:510px; width: 225px; float:left; padding-bottom: 0px;">
        <legend>功能菜单</legend>
        <div id="role-fun-layout-01" style="height:94%; overflow:auto;width: 200px;">
            <ul id="roleztree" class="ztree" style="width: 190px;" data-toggle="ztree"
			      data-options='{nodes:${menus}, expandAll:true,onClick:"menuTreeOnclick"}'>
			</ul>
        </div>
    </fieldset>
    <form id="roleFunForm" data-toggle="validate"	data-alertmsg="true">
    <fieldset style="height:510px; width: 650px;float:left; margin-left:10px; padding-bottom: 0px;">
    	<legend>权限</legend>
    	<div id="role-fun-layout-02" style="height:485px; overflow:auto;width: 635px;">
    	
    	</div>
    </fieldset>
    </form>
</div>
<div class="bjui-pageFooter">
	<ul>
		<li><button type="button" class="btn btn-red cancel"
				data-icon="remove" onclick="closePermissionSet();">关闭</button></li>
	</ul>
</div>